package com.ruoyi.production.service.impl.seed;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.production.domain.seed.SeedPurchaseApply;
import com.ruoyi.production.mapper.seed.SeedPurchaseApplyMapper;
import com.ruoyi.production.service.seed.ISeedPurchaseApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 种子购买申请Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-07
 */
@Service
public class SeedPurchaseApplyServiceImpl implements ISeedPurchaseApplyService
{
    @Autowired
    private SeedPurchaseApplyMapper seedPurchaseApplyMapper;

    /**
     * 查询种子购买申请
     *
     * @param seedPurchaseApplyId 种子购买申请ID
     * @return 种子购买申请
     */
    @Override
    public SeedPurchaseApply selectSeedPurchaseApplyById(Long seedPurchaseApplyId)
    {
        return seedPurchaseApplyMapper.selectSeedPurchaseApplyById(seedPurchaseApplyId);
    }

    /**
     * 查询种子购买申请列表
     *
     * @param seedPurchaseApply 种子购买申请
     * @return 种子购买申请
     */
    @Override
    public List<SeedPurchaseApply> selectSeedPurchaseApplyList(SeedPurchaseApply seedPurchaseApply)
    {
        return seedPurchaseApplyMapper.selectSeedPurchaseApplyList(seedPurchaseApply);
    }

    /**
     * 新增种子购买申请
     *
     * @param seedPurchaseApply 种子购买申请
     * @return 结果
     */
    @Override
    public int insertSeedPurchaseApply(SeedPurchaseApply seedPurchaseApply)
    {
        seedPurchaseApply.setCreateTime(DateUtils.getNowDate());
        return seedPurchaseApplyMapper.insertSeedPurchaseApply(seedPurchaseApply);
    }

    /**
     * 修改种子购买申请
     *
     * @param seedPurchaseApply 种子购买申请
     * @return 结果
     */
    @Override
    public int updateSeedPurchaseApply(SeedPurchaseApply seedPurchaseApply)
    {
        seedPurchaseApply.setUpdateTime(DateUtils.getNowDate());
        return seedPurchaseApplyMapper.updateSeedPurchaseApply(seedPurchaseApply);
    }

    /**
     * 批量删除种子购买申请
     *
     * @param seedPurchaseApplyIds 需要删除的种子购买申请ID
     * @return 结果
     */
    @Override
    public int deleteSeedPurchaseApplyByIds(Long[] seedPurchaseApplyIds)
    {
        return seedPurchaseApplyMapper.deleteSeedPurchaseApplyByIds(seedPurchaseApplyIds);
    }

    /**
     * 删除种子购买申请信息
     *
     * @param seedPurchaseApplyId 种子购买申请ID
     * @return 结果
     */
    @Override
    public int deleteSeedPurchaseApplyById(Long seedPurchaseApplyId)
    {
        return seedPurchaseApplyMapper.deleteSeedPurchaseApplyById(seedPurchaseApplyId);
    }
}
